#!/usr/bin/env bash

set -e

TARGET="/tmp/t.list"
FULL_TARGET=()
#declare -i i
function format_listfile()
{
    TARGET=$1
    sed -i "s/\w*://g" $TARGET
    sed -i "/^\r$/d" $TARGET
    sed -i "/^\n$/d" $TARGET
    sed -i "/^$/d" $TARGET
    sed -i "s/\^/\*\*/g" $TARGET
    sed -i "/^$/d" $TARGET
    FULL_TARGET[i++]=$TARGET
    #echo "${FULL_TARGET[@]}"
}

if [ $# -lt 1 ];then
    exit
fi

while [ $# -gt 0 ]
do
    format_listfile $1
    shift
done

# 自动调用绘图脚本
python show_sin.py "${FULL_TARGET[@]}"
